/*
 *  WaveTableFactoryTester.cpp
 *  SoundController0002
 *
 *  Created by jiro on 10/11/13.
 *  Copyright 2010 jiro music. All rights reserved.
 *
 */

#include "WaveTableFactoryTester.h"
#include "../SoundController.h"
#include "CustomAssert.h"

namespace sc {

	void WaveTableFactoryTester::TestAll()
	{
		Test_Create_001();

		Test_Create_002();
	}

	void WaveTableFactoryTester::Test_Create_001()
	{
		double length = 1.5;
		double powerOfX = 1;
		const WaveFunction& function = WaveFunctionFactory::CreateXSinX( powerOfX, 2 * length );
		const WaveFunction& functionRev = WaveFunctionFactory::CreateXSinX( powerOfX, 2 * length, true );
		const WaveTable& dynamicsTable = WaveTableFactory::Create( function, 1 );
		const WaveTable& dynamicsTableRev = WaveTableFactory::Create( functionRev, 1 );

		AssertNotEqual( & dynamicsTable, & dynamicsTableRev );
	}
	
	void WaveTableFactoryTester::Test_Create_002()
	{
		const WaveTable& table1 = WaveTableFactory::Create( WaveTable::Type_Sine, 1.0 / ( 2.0 * 3.3333 ), 0.625 );
		const WaveTable& table2 = WaveTableFactory::Create( WaveTable::Type_Sine, 1.0 / ( 2.0 * 3.3333 ), 0.625 );
		
		AssertEqual( table1 == table2, true );
//		AssertEqual( & table1, & table2 );
		AssertFalse( table1 < table2 );

	}

}
